#pragma once
#include "RFDeviceObjectNet.h"
#include "include\RFDeviceDefs.h"

using namespace System;
using namespace System::Runtime::InteropServices;
using namespace RFDevice;

namespace RFDeviceNet{
	public ref class RFdeviceDefsNet
	{
	public:
		RFdeviceDefsNet();
		static void NetArrayToNativeArray(array<unsigned char>^ netArray, unsigned char* nativeArray, int size);
		static void NativeArrayToNetArray(array<unsigned char>^% netArray, unsigned char* nativeArray, int size);
	};
	
	public ref struct _UDP_DEVINFOBLOCK_PC_Net {
	public:
		_UDP_DEVINFOBLOCK_PC_Net();		
		unsigned short DeviceType;
		array<unsigned char>^ IP;
		array<unsigned char>^ MAC;
		array<unsigned char>^ Info;

		_UDP_DEVINFOBLOCK_PC_Net^ GetNext();
		void SetNext(_UDP_DEVINFOBLOCK_PC_Net^ devBlock);
		RFDevice::_UDP_DEVINFOBLOCK_PC  * pNextDevBlock;
		RFDevice::_UDP_DEVINFOBLOCK_PC  * _pDevBlock;
		//RFDevice::_UDP_DEVINFOBLOCK_PC  * GetDevBlock();
		void GetDevBlock(RFDevice::_UDP_DEVINFOBLOCK_PC* devBlock);
		_UDP_DEVINFOBLOCK_PC_Net(RFDevice::_UDP_DEVINFOBLOCK_PC  * pDevBlock);
	};

	/*
	[StructLayout(LayoutKind::Sequential)]
	public ref struct _UDP_DEVINFOBLOCK_PC_Net
	{
	public:
		unsigned short					usDeviceType;
		[MarshalAs(UnmanagedType::ByValArray, SizeConst=4)]
		static array<unsigned char>^	IP;
		[MarshalAs(UnmanagedType::ByValArray, SizeConst=6)]
		array<unsigned char>^	MAC;
		[MarshalAs(UnmanagedType::ByValArray, SizeConst=256)]
		array<unsigned char>^	Info;
		IntPtr							pNext;
	};*/

	public ref struct _RF60x_HELLO_ANSWER_Net
	{		
	public:
		BYTE	DeviceType;
		BYTE	DeviceModificaton;
		WORD	DeviceSerial;
		WORD	DeviceMaxDistance;
		WORD	DeviceRange;
		void GetOriginal(_RF60x_HELLO_ANSWER_* ans);
		_RF60x_HELLO_ANSWER_Net() {};
		_RF60x_HELLO_ANSWER_Net(_RF60x_HELLO_ANSWER_* origin);
	};

	public ref struct _RF60x_STREAM_VALUE_Net
	{
	public:
		WORD	Measure;
		BYTE	Status;
		void GetOriginal(_RF60x_STREAM_VALUE_*);
		_RF60x_STREAM_VALUE_Net() {};
		_RF60x_STREAM_VALUE_Net(_RF60x_STREAM_VALUE_* origin);
	};

	public ref struct _RF60x_UDP_PACKET_Net
	{
	public:
		array<_RF60x_STREAM_VALUE_Net^>^ rf60xValArray;
		WORD	DeviceSerial;
		WORD	DeviceBaseDistance;
		WORD	DeviceMeasureRange;
		BYTE	PackCount;
		BYTE	PacketControlSumm;
		void GetOriginal(_RF60x_UDP_PACKET_*);
		_RF60x_UDP_PACKET_Net();
		_RF60x_UDP_PACKET_Net(_RF60x_UDP_PACKET_* origin);
	};
}

